import { post, get } from '@/utils/http'
import type {ICustomersType,IAddUserFormType,UsersListType} from '@/typings/usersType'

// 用户列表
export const getUsersApi = (page = 1, query = '', size = 10) =>
  get<ICustomersType>(`/api/users?page=${page}&size=${size}${query}`)

//检查输入框
export const checkUserNameApi = (username: string) => 
  post<number>(`/api/checkUsernameApi`,{username})

//添加用户
export const addUserApi = (userData:IAddUserFormType) => 
  post<UsersListType>(`/api/users`,userData)
